package com.example.emos.api.config;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Configuration;

/**
 * SpringDoc的配置我们需要创建一个配置类，至于类的名字叫什么无所谓
 * Swagger配置兼容JWT需要配置链式调用非常麻烦，淘汰了Swagger，替换
 * 成了SpringDoc，SpringDoc的功能与Swagger几乎一模一样，但是配置起来很简单
 * 几个注解就能解决
 */
@Configuration
@OpenAPIDefinition(
        info = @Info(
                title = "emos-api",
                description = "在线办公系统后端Java项目",
                version = "1.0"
        ),
        security = @SecurityRequirement(name = "token")
)
@SecurityScheme(
        name = "token",
        type = SecuritySchemeType.APIKEY,
        in = SecuritySchemeIn.HEADER,
        bearerFormat = "JWT",
        scheme = "bearer"
)
public class SpringDocConfig {


}